
package com.fly.data.jdbc.domain;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Range;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

import lombok.Data;

@Data
@Table("user")
public class User
{
    @Id
    @Column("id")
    private Long id;
    
    @NotBlank(message = "用户名不能为空")
    @Column("user_name")
    private String userName;
    
    @NotNull(message = "年龄不能为空")
    @Range(min = 10, max = 50, message = "年龄必须在{min}-{max}")
    @Column("age")
    private Integer age;
    
    @Column("time")
    private Date time;
}
